// Pinia Store 类型定义

// Adminer 相关类型
export interface Adminer {
	mobile: string
	is_super: number
	account_name: string
	created_at: number
	status: number
	updated_at: number
	_created_at: string
	_updated_at: string
}

export interface Permission {
	id: string
	name: string
	code: string
	description?: string
}

export interface AdminerState {
	adminer: Adminer
	permissions: Permission[]
}

// Currency 相关类型
export type CurrencyCode = 'CNY' | 'USD' | 'RUB'

export interface CurrencyInfo {
	code: CurrencyCode
	symbol: string
	name: string
	rate: number
}

export interface CurrencyState {
	currentCurrency: CurrencyCode
}

// Language 相关类型
export type LanguageCode = 'zh-CN' | 'en-US' | 'ru-RU'

export interface LanguageOption {
	label: string
	value: LanguageCode
}

export interface LanguageState {
	currentLanguage: LanguageCode
}

// JWT Token 相关类型
export interface JwtPayload {
	token: string
	end_at: number
}

export interface JwtTokenState {
	token: string
	key: string
	payload: JwtPayload
}

// Loading 相关类型
export interface LoadingState {
	isLoading: boolean
}

// Test 相关类型
export interface TestState {
	count: number
}

// Store 类型导出
export type StoreId = 'adminer' | 'currency' | 'language' | 'jwtToken' | 'loading' | 'test'

// Store 实例类型
export type StoreInstances = {
	adminer: ReturnType<typeof import('../stores/pinia/Adminer').useAdminerStore>
	currency: ReturnType<typeof import('../stores/pinia/Currency').useCurrencyStore>
	language: ReturnType<typeof import('../stores/pinia/Language').useLanguageStore>
	jwtToken: ReturnType<typeof import('../stores/pinia/JwtToken').useTokenStore>
	loading: ReturnType<typeof import('../stores/pinia/Loading').useLoadingStore>
	test: ReturnType<typeof import('../stores/pinia/Test').useTestStore>
}
